package com.cf.studiomanage.service.impl;

import com.cf.studiomanage.entity.Finance;
import com.cf.studiomanage.mapper.FinanceMapper;
import com.cf.studiomanage.service.FinanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FinanceServiceImpl implements FinanceService {

    @Autowired
    private FinanceMapper mapper;

    @Override
    public boolean addRecord(Finance finance) {
        return mapper.addRecord(finance) > 0;
    }

    @Override
    public List<Finance> getAll() {
        return mapper.getAll();
    }

    @Override
    public List<Finance> getByUser(Long userId) {
        return mapper.getByUser(userId);
    }

    @Override
    public boolean deleteById(Long id) {
        return mapper.deleteById(id) > 0;
    }
}
